package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/6
 */
public class ViewCommand implements ResourceCommand {
    private AddressBook addressBook;
    private String name;

    public ViewCommand(AddressBook addressBook, String name) {
        this.addressBook = addressBook;
        this.name = name;
    }

    @Override
    public void execute() {
        addressBook.viewContact(name);
    }

    @Override
    public void undo() {
        System.out.println("查看操作不可撤销");
    }
}